/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-01-04 18:56:01
 * @LastEditors: Clark
 * @LastEditTime: 2023-01-04 18:58:10
 * @Description: file content
 */

#include "apue.h"
#include <setjmp.h>

#define TOK_ADD 5

jmp_buf jmpbuffer;

int main()
{
    char line[MAXLINE] = {0};

    if (0 != setjmp(jmpbuffer))
    {
        printf("error");
    }

    while (1)
    {
        if (NULL == fgets(line, MAXLINE, stdin))
        {
            break;
        }

        doline(line);
    }

    exit(0);
}

void cmd_add()
{
    int token = get_token();
    if (token < 0)
    {
        longjmp(jmpbuffer, 1);
    }
}
